home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume10 / comobj.lisp / part01 next >
Encoding:
Internet Message Format  |  1987-07-30  |  59.5 KB

  1. Path: uunet!rs
  2. From: rs@uunet.UU.NET (Rich Salz)
  3. Newsgroups: comp.sources.unix
  4. Subject: v10i075:  Common Objects, Common Loops, Common Lisp, Part01/13
  5. Message-ID: <742@uunet.UU.NET>
  6. Date: 31 Jul 87 19:57:05 GMT
  7. Organization: UUNET Communications Services, Arlington, VA
  8. Lines: 1734
  9. Approved: rs@uunet.UU.NET
  10.  
  11. Submitted-by: Roy D'Souza <dsouza%hplabsc@hplabs.HP.COM>
  12. Posting-number: Volume 10, Issue 75
  13. Archive-name: comobj.lisp/Part01
  14.  
  15. #! /bin/sh
  16. # This is a shell archive.  Remove anything before this line, then unpack
  17. # it by saving it into a file and typing "sh file".  To overwrite existing
  18. # files, type "sh file -c".  You can also feed this as standard input via
  19. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  20. # will see the following message at the end:
  21. #        "End of archive 1 (of 13)."
  22. # Contents:  MANIFEST README co-defsys.l compat.l compile-it.sh
  23. #   excl-low.l hp-low.l kcl-low.l lucid-low.l ntype-of.l
  24. #   semantics.asci spice-low.l sublines ti-low.l trapd.l vaxl-low.l
  25. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  26. if test -f 'MANIFEST' -a "${1}" != "-c" ; then 
  27.   echo shar: Will not clobber existing file \"'MANIFEST'\"
  28. else
  29. echo shar: Extracting \"'MANIFEST'\" \(1464 characters\)
  30. sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
  31. X   File Name        Archive #    Description
  32. X-----------------------------------------------------------
  33. X 3600-low.l                2    
  34. X MANIFEST                  1    This shipping list
  35. X README                    1    
  36. X braid.l                  10    
  37. X class-prot.l              8    
  38. X class-slots.l             4    
  39. X co-defsys.l               1    
  40. X co-dmeth.l                7    
  41. X co-dtype.l               11    
  42. X co-macros.l               2    
  43. X co-meta.l                 3    
  44. X co-parse.l               13    
  45. X co-prof.l                 2    
  46. X co-sfun.l                 2    
  47. X co-test.l                 2    
  48. X compat.l                  1    
  49. X compile-it.sh             1    
  50. X defclass.l                4    
  51. X defsys.l                  3    
  52. X dfun-templ.l              2    
  53. X excl-low.l                1    
  54. X fixup.l                   3    
  55. X fsc-low.l                 4    
  56. X gfun-low.l                6    
  57. X high.l                    3    
  58. X hp-low.l                  1    
  59. X kcl-low.l                 1    
  60. X low.l                     8    
  61. X lucid-low.l               1    
  62. X macros.l                  7    
  63. X meth-combi.l              5    
  64. X methods.l                12    
  65. X ntype-of.l                1    
  66. X pcl-patches.l             2    
  67. X profmacs.l                5    
  68. X regress.l                 4    
  69. X semantics.asci            1    
  70. X spice-low.l               1    
  71. X sublines                  1    
  72. X test.l                    6    
  73. X ti-low.l                  1    
  74. X trapd.l                   1    
  75. X vaxl-low.l                1    
  76. X walk.l                    9    
  77. X xerox-low.l               2    
  78. END_OF_FILE
  79. if test 1464 -ne `wc -c <'MANIFEST'`; then
  80.     echo shar: \"'MANIFEST'\" unpacked with wrong size!
  81. fi
  82. # end of 'MANIFEST'
  83. fi
  84. if test -f 'README' -a "${1}" != "-c" ; then 
  85.   echo shar: Will not clobber existing file \"'README'\"
  86. else
  87. echo shar: Extracting \"'README'\" \(13990 characters\)
  88. sed "s/^X//" >'README' <<'END_OF_FILE'
  89. X        Revised Instructions for Installing and Using 
  90. X        CommonObjects on CommonLoops
  91. X            (COOL)
  92. X
  93. XI) INTRODUCTION
  94. X
  95. XCOOL is an implementation of HP's CommonObjects on
  96. Xthe Portable CommonLoops (PCL) metaclass kernel.
  97. XAs such, it provides a portable implementation of
  98. XCommonObjects. It should be of particular interest
  99. Xto people who want to program in the mixin style
  100. Xsupported by PCL but are also interested in trying
  101. Xthe encapsulation style of Smalltalk, which CommonObjects
  102. Xsupports.
  103. X
  104. XThis version of COOL is guaranteed to work with Portable
  105. XCommonLoops system date 2-24-87. A copy of this version
  106. Xof Portable CommonLoops is distributed along with COOL.
  107. X
  108. XCOOL comes as a set of files grouped into four groups:
  109. X
  110. X  1) Documentation
  111. X
  112. X     README-this file
  113. X
  114. X     semantics.asci-Description of semantic differences
  115. X       between the CommonObjects specification in the
  116. X       document ATC-85-01, "Object Oriented Programming
  117. X       for Common Lisp," by Alan Snyder.
  118. X
  119. X  2) The System
  120. X     co-defsys.l
  121. X     pcl-patches.l
  122. X     co-parse.l
  123. X     co-dtype.l
  124. X     co-meta.l
  125. X     co-dmeth.l
  126. X     co-sfun.l
  127. X
  128. X  3) Test and Profiling files
  129. X
  130. X     co-test.l-A generalized version of the PCL test macro.
  131. X     co-regress.l-Some simple regression tests for COOL.
  132. X     co-profmacs.l-Macros for simplifying profiling.
  133. X     co-prof.l-Profiling tests.
  134. X
  135. X  4) Portable CommonLoops (system date 2-24-87)
  136. X     The file <xxx>-low.l corresponds to the machine-dependent
  137. X     file for your system. For HP Lisp, this will be hp-low.l.
  138. X
  139. X     walk.l
  140. X     macros.l
  141. X     low.l
  142. X     <xxx>-low.l
  143. X     braid.l
  144. X     class-slots.l
  145. X     defclass.l
  146. X     class-prot.l
  147. X     methods.l
  148. X     dfun-templ.l
  149. X     fixup.l
  150. X     high.l
  151. X     compat.l
  152. X
  153. XIf you are on a Un*x system, the COOL files will be in the
  154. Xdirectory co/ and the PCL files will be in the directory pcl/.
  155. X
  156. XIf you have never programmed using CommonObjects, it is
  157. Xsuggested you request a paper copy of ATC-85-01, "Object
  158. XOriented Programming for Common Lisp," by Alan Snyder;
  159. Xwhich is a specification of the CommonObjects language.
  160. XIt can be obtained by sending electronic mail with your
  161. Xname and address to mingus@hplabs.hp.com. If you are anxious
  162. Xto get started and don't want to wait for the specification,
  163. Xlook at some of the test examples in co-regress.l for
  164. Xan idea of how to use CommonObjects.
  165. X
  166. XII) BRINGING UP PORTABLE COMMONLOOPS
  167. XDirections are given in the file defsys.l
  168. XBriefly, one edits the variables *pcl-pathname-defaults* (which
  169. Xgives the location of the PCL files on your system). After that 
  170. Xthe PCL files can be compiled by invoking:
  171. X
  172. X   (require "defsys")
  173. X   (pcl::compile-pcl)
  174. X
  175. Xand loaded by invoking:
  176. X
  177. X   (pcl::load-pcl)
  178. X
  179. XIII) BRINGING UP COOL
  180. X
  181. XCool uses the PCL defsystem. Directions are given in the file
  182. Xco-defsys.l . Briefly, in file co-defsys.l, one sets the variable
  183. X*co-pathname-defaults* to correspond to the location of the files
  184. Xon your local system. After that, the COOL files may be compiled by invoking:
  185. X
  186. X   (require "co-defsys")
  187. X   (co:compile-co)
  188. X
  189. Xand loaded by invoking:
  190. X
  191. X   (co:load-co)
  192. X
  193. XIn addition, the file pcl-patches.l contains a patch for
  194. Xthe PCL function CLASS-OF. This function is specialized
  195. Xfor each implementation of Common Lisp, but, in the
  196. Xreleased version, it does not check if the type specifier
  197. Xreturned by TYPE-OF is list. You will need to modify
  198. Xthe SETQ of *CLASS-OF* in your implementation xxx-low.l
  199. Xfile so that the function PCL::ATOM-TYPE-OF is called
  200. Xon (TYPE-OF X) instead of simply TYPE-OF. To see how this was
  201. Xdone for HP Lisp, look at the top of pcl-patches.l
  202. XRemember to put the form:
  203. X
  204. X(eval-when (load eval)
  205. X  (recompile-class-of)
  206. X
  207. X)
  208. X
  209. Xin your file after you have rebound *CLASS-OF*; otherwise,
  210. Xthe new definition will not take effect.
  211. X
  212. XIII) COMPILATION
  213. X
  214. XYou will probably want to compile COOL before using it,
  215. Xunless your system doesn't have a compiler. There
  216. Xare only three files in the COOL system itself. If
  217. Xyou have set up your pathnames for REQUIRE correctly,
  218. Xthen the following script should compile COOL:
  219. X
  220. X   (require "co-defsys")
  221. X   (co:compile-co)
  222. X
  223. XYou may want to turn on optimizations before compiling.
  224. XBefore doing this, it is suggested that you try the
  225. Xregression tests without any optimizations, in case
  226. Xyour optimizer does something which might cause the
  227. Xsystem to break (like not checking for NIL during
  228. Xa CAR or CDR operation). For profiling, however, it
  229. Xis best to put as much optimization on as you think
  230. Xcan safely be done.
  231. X
  232. XIV) LOADING
  233. X
  234. XTo load the system, do the following:
  235. X (require "co-defsys")
  236. X (co:load-co)
  237. X
  238. XV) USE
  239. X
  240. XThere are two steps needed to use the CommonObjects
  241. Xobject oriented language extensions within your
  242. XCommon Lisp. 
  243. X
  244. XFirst, in the package where you plan to use
  245. XCommonObjects, you need to get access to the CommonObjects
  246. Xfunctions and macros. Do that by using the USE-PACKAGE
  247. Xform:
  248. X
  249. X(in-package <your package>)
  250. X(use-package 'co)
  251. X
  252. XYou will now have access to CommonObjects. Note to
  253. Xusers on HP Lisp: it is not possible to use both
  254. XCOOL and the system dependent CommonObjects implementation
  255. Xin the same package, since a symbol conflict occurs
  256. Xupon import of the CommonObjects symbols.
  257. X
  258. XIt is suggested that you avoid trying to use both
  259. XPCL and COOL in the same package. It MAY work,
  260. Xhowever, it has not been tried and is therefore
  261. Xuntested. As a matter of good software engineering,
  262. Xit also seems best to try to segment applications
  263. Xwhich use both objects in different packages.
  264. X
  265. XSecond, there are a number of Common Lisp functions which
  266. XCommonObjects semantics modify. These are EQL, EQUAL, EQUALP,
  267. XTYPE-OF, and TYPEP. For more information on exactly what
  268. Xthese modifications are, see ATC-85-01. Because redefining
  269. Xthe default Lisp functions could be potentially very 
  270. Xdangerous or cause serious performance degradation, a 
  271. Xspecial macro has been constructed which SHADOWING-IMPORTs
  272. Xthe redefined functions into a package using CO, without
  273. Xredefining the Common Lisp functions throughout the entire
  274. Xsystem. To get access to these functions, the macro
  275. XIMPORT-SPECIALIZED-FUNCTIONS needs to be invoked after the
  276. XCO package is used:
  277. X
  278. X    (import-specialized-functions)
  279. X
  280. XThe Common Lisp functions will now locally reflect the
  281. XCommonObjects semantics, but the global definitions
  282. Xare still available by using full package qualification
  283. Xof the names.
  284. X
  285. XHere is a short description of the available CommonObjects
  286. Xoperations exported from CO. For a more detailed description,
  287. Xsee ATC-85-01.
  288. X
  289. X(define-type <type name> <options>)        
  290. X
  291. XDefine a CommonObjects type whose name is <type name>. There
  292. Xare a whole host of options, including instance variable
  293. X(slot) definition and inheritence. Macro.
  294. X
  295. X(define-method (<type name> <method name>) (<arguments>)  
  296. X    <body>
  297. X)
  298. X
  299. XDefine a CommonObjects method named <method name> on <type name>.
  300. X<method name> will typically be a keyword but need not be. Macro.
  301. X
  302. X(call-method (<parent type name> <parent method name>) <arguments>) 
  303. X(call-method <method name> arguments)
  304. X
  305. X(apply-method (<parent type name> <parent method name>) &rest <arguments>)
  306. X(apply-method <method name> &rest arguments)
  307. X
  308. XUsed to invoke a parent method or a method on SELF. The difference 
  309. Xfrom sending to SELF directly is that the method to call is
  310. Xdetermined at compile time. The CALL-METHOD form is like FUNCALL,
  311. XAPPLY-METHOD like APPLY. These forms are only valid within the
  312. Xbody of a DEFINE-METHOD. Macros.
  313. X
  314. X(make-instance <type name> <initialization keyword list>)
  315. X
  316. XMake an instance of CommonObjects type <type name> The
  317. X<initialization keyword list> is used to initialize
  318. Xinstance variables and for other initialization purposes.
  319. XPCL method.
  320. X
  321. X(=> <instance> <method name> <arguments>)
  322. X
  323. XInvoke operation <method name> on <instance> with <arguments>.
  324. XThis invocation operator makes no checks for errors and
  325. Xoperates at full PCL messaging speed. Note that all arguments
  326. Xwill be evaluated. Macro.
  327. X
  328. X(send? <instance> <method name> <arguments>)
  329. X
  330. XInvoke operation <method name> on <instance> with <arguments>,
  331. Xchecking to be sure <instance> is a valid CommonObjects
  332. Xinstance and that it supports <method name> as an operation.
  333. XReturns NIL if the operation cannot be invoked. This
  334. Xinvocation operator is slow but safe. Note that all arguments
  335. Xwill be evaluated. Macro.
  336. X
  337. X(instancep <arg>)
  338. X
  339. XReturns T if <arg> is a CommonObjects instance, NIL if
  340. Xnot. Function.
  341. X
  342. X(supports-operation-p <arg> <method name>)
  343. X
  344. XReturns T if <arg> supports operation <method name>,
  345. XNIL if not. Function.
  346. X
  347. X(assignedp <instance variable name>)
  348. X
  349. XReturns T if <instance variable name> has been assigned
  350. Xa value, NIL if not. Valid only within a DEFINE-METHOD
  351. Xbody. Macro.
  352. X
  353. X(undefine-type <type name>)
  354. X
  355. XUndefine the CommonObjects type <type name>. Returns T
  356. Xif the type was undefined, NIL if not. Signals an error
  357. Xif the argument is not a symbol. Function.
  358. X
  359. X(rename-type <old type name> <new type name>)
  360. X
  361. XRename <old type name> to <new type name>. Returns T
  362. Xif the type was renamed. Signals an error if old
  363. Xtype is not defined, if new type already exists,
  364. Xor if the arguments are not symbols. Function.
  365. X
  366. X(undefine-method <type name> <method name>)
  367. X
  368. XUndefine the method <method name> on <type name>.
  369. XSignals an error if <type name> is not a symbol or
  370. Xif there is no type named <type name>. Issues a
  371. Xwarning message if <method name> is a universal
  372. Xmethod and the type has the default universal
  373. Xmethods. Returns T if the operation was successful,
  374. XNIL if not. Function.
  375. X
  376. X
  377. XVI) REGRESSION TESTS
  378. X
  379. XThe file co-regress.l contains a series of regression
  380. Xtests which test out important features of COOL.
  381. XSome of these regression tests cause errors to be
  382. Xsignalled, but, in order to have the tests complete
  383. Xsuccessfully, the errors must be ignored. Since there
  384. Xis no portable way defined in CLtL to modify error
  385. Xhandling (short of redefining the CL function ERROR)
  386. Xmost system implementors have added extensions to
  387. Xdo the job.
  388. X
  389. XIf you don't know what the extensions are on your
  390. Xsystem, or don't want to be bothered about trying
  391. Xto find out, skip this paragraph and go on to
  392. Xthe next, but first a warning: the tests requiring
  393. Xerror handling will be skipped, but the result
  394. Xmay be that some implementation dependent problem
  395. Xis missed. If you know what the extensions are,
  396. Xthen edit the file co-test.l. Go to the top
  397. Xof the file and look for the special variable
  398. X*WITHOUT-ERRORS*. This variable should contain
  399. Xa function which generates the test with an error
  400. Xcatcher in place around the code. Add
  401. X#+<implementation name> to the list, and a LAMBDA
  402. Xdefinition to return the proper test code with
  403. Xerror catching. Note that the code should return T
  404. Xif an error occurs, and NIL if not, for the
  405. Xtest macro to work correctly. When you are done,
  406. Xmail that portion of the file with your system
  407. Xdependent code to cool@hplabs.hp.com.
  408. X
  409. XTo run the regression tests, simply REQUIRE the
  410. Xfile co-regress.l:
  411. X
  412. X    (require "co-regress")
  413. X
  414. XThe test results will be printed to the standard
  415. Xoutput.
  416. X
  417. XNote that the regression tests make no checks
  418. Xfor compilation, since the compilation semantics
  419. Xof PCL (upon which COOL is based) are very weakly
  420. Xdefined. File compilation should work, however.
  421. X
  422. XVII) PROFILING
  423. X
  424. XIf you're really feeling ambitious, you may even
  425. Xwant to run the profiling tests to see how well
  426. Xyour COOL is performing. 
  427. X
  428. XAgain, there are some implementation dependencies 
  429. Xwhich should be addressed before running the profiling
  430. Xtests. Probably the most important is that the name
  431. Xof the implementation's garbage collector be known.
  432. XIf this is NOT done, then you run the risk of having
  433. Xa garbage collect occur in the middle of the profiling,
  434. Xwhich will destroy your measurements. If your system
  435. Xhas a large enough virtual image, however, garbage
  436. Xcollection may not be a problem.
  437. X
  438. XEdit the file co-profmacs.l and look at the top below
  439. Xthe header. The function cell of the symbol
  440. XDO-GARBAGE-COLLECT should be set to the function
  441. Xfor your implementation's garbage collector. Be
  442. Xsure to put a #+<implementation name> before any
  443. Ximplementation dependent code you may add. The default
  444. Xfor garbage collection is to simply warn the user
  445. Xthat the measurements may be in error because
  446. Xthe test can't garbage collect.
  447. X
  448. XYou may also want to add any implementation dependent
  449. Xcode for getting clock values. The default is the
  450. XCommon Lisp function GET-INTERNAL-REAL-TIME, and
  451. Xthe clock increment in milliseconds (in the
  452. Xspecial variable *CLOCK-INCREMENT-IN-MILLISECONDS*)
  453. Xis calculated using the Common Lisp special
  454. XINTERNAL-TIME-UNITS-PER-SECOND. However, many
  455. Ximplementations may have special ways of getting 
  456. Xclock values, and these should be added here.
  457. X
  458. XPlease send any implementation dependent changes
  459. Xto cool@hplabs.hp.com.
  460. X
  461. XThe results of the profiling tests are put into
  462. Xa file whose name (as a string) is bound to the
  463. Xspecial variable TEST::*OUTPUT-FILE-NAME*. The
  464. Xdefault string is "runprof.out", as can be
  465. Xseen by checking the special variable definition
  466. Xfor *OUTPUT-FILE-NAME* at the top of co-prof.l.
  467. XIf you want the results in another file, please
  468. XSETF this variable to the file name before
  469. Xstarting the profiling:
  470. X
  471. X    (in-package 'test)
  472. X    (setf *output-file-name* <your file name>)
  473. X
  474. XTo run the profiling tests, just:
  475. X
  476. X    (require "co-prof")
  477. X
  478. Xand, providing you've set up your REQUIRE pathnames
  479. Xcorrectly, you should find it.
  480. X
  481. XNote that profiling may take quite a while, and
  482. Xit is a good idea to have as little else going on
  483. Xon your machine as possible during the tests.
  484. X
  485. XIf you feel you want to distribute the profile
  486. Xinformation, you may want to send it to 
  487. Xcool@hplabs.hp.com with a brief description of
  488. Xyour system. It might help identify particular
  489. Ximplementation dependencies which are causing
  490. Xperformance problems.
  491. X
  492. XVIII) CONCLUSION
  493. X
  494. XIf you have problems with COOL or find any bugs,
  495. Xplease report them to cool@hplabs.hp.com. It
  496. Xis most helpful if the bug can be as isolated
  497. Xas possible (e.g. "It broke when I defined
  498. Xtype xxx" is less easy to trace down than
  499. Xa backtrace listing where it broke). It may
  500. Xbe difficult to track all implementations of
  501. XCommon Lisp, but an effort will be made to
  502. Xkeep COOL running as long as people are
  503. Xinterested.
  504. X
  505. END_OF_FILE
  506. if test 13990 -ne `wc -c <'README'`; then
  507.     echo shar: \"'README'\" unpacked with wrong size!
  508. fi
  509. # end of 'README'
  510. fi
  511. if test -f 'co-defsys.l' -a "${1}" != "-c" ; then 
  512.   echo shar: Will not clobber existing file \"'co-defsys.l'\"
  513. else
  514. echo shar: Extracting \"'co-defsys.l'\" \(4339 characters\)
  515. sed "s/^X//" >'co-defsys.l' <<'END_OF_FILE'
  516. X;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  517. X;
  518. X; File:         co-defsys.l
  519. X; RCS:          $Revision: 1.1 $
  520. X; SCCS:         %A% %G% %U%
  521. X; Description:  System Definition for CommonObjects
  522. X; Author:       James Kempf, HP/DCC
  523. X; Created:      11-Mar-87
  524. X; Modified:     11-Mar-87 22:08:34 (James Kempf)
  525. X; Language:     Lisp
  526. X; Package:      COMMON-OBJECTS
  527. X; Status:       Distribution
  528. X;
  529. X; (c) Copyright 1987, HP Labs, all rights reserved.
  530. X;
  531. X;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  532. X;
  533. X; Copyright (c) 1987 Hewlett-Packard Corporation. All rights reserved.
  534. X;
  535. X; Use and copying of this software and preparation of derivative works based
  536. X; upon this software are permitted.  Any distribution of this software or
  537. X; derivative works must comply with all applicable United States export
  538. X; control laws.
  539. X; 
  540. X; This software is made available AS IS, and Hewlett-Packard Corporation makes
  541. X; no warranty about the software, its performance or its conformity to any
  542. X; specification.
  543. X;
  544. X; Suggestions, comments and requests for improvement may be mailed to
  545. X; aiws@hplabs.HP.COM
  546. X
  547. X;;;-*-Mode:LISP; Package:(PCL LISP 1000); Base:10; Syntax:Common-lisp -*-
  548. X;;;
  549. X;;; *************************************************************************
  550. X;;; Copyright (c) 1985, 1986, 1987 Xerox Corporation.  All rights reserved.
  551. X;;;
  552. X;;; Use and copying of this software and preparation of derivative works
  553. X;;; based upon this software are permitted.  Any distribution of this
  554. X;;; software or derivative works must comply with all applicable United
  555. X;;; States export control laws.
  556. X;;; 
  557. X;;; This software is made available AS IS, and Xerox Corporation makes no
  558. X;;; warranty about the software, its performance or its conformity to any
  559. X;;; specification.
  560. X;;; 
  561. X;;; Any person obtaining a copy of this software is requested to send their
  562. X;;; name and post office or electronic mail address to:
  563. X;;;   CommonLoops Coordinator
  564. X;;;   Xerox Artifical Intelligence Systems
  565. X;;;   2400 Hanover St.
  566. X;;;   Palo Alto, CA 94303
  567. X;;; (or send Arpanet mail to CommonLoops-Coordinator.pa@Xerox.arpa)
  568. X;;;
  569. X;;; Suggestions, comments and requests for improvements are also welcome.
  570. X;;; *************************************************************************
  571. X;;;
  572. X
  573. X(provide "co-defsys")
  574. X
  575. X(in-package 'common-objects :nicknames '(co) :use '(lisp pcl walker))
  576. X
  577. X(export '(compile-co 
  578. X      load-co
  579. X      run-tests
  580. X    ))
  581. X    
  582. X(require "pcl")           ;  Portable CommonLoops
  583. X
  584. X(defvar *co-system-date* "3/10/87")
  585. X
  586. X(defvar *co-pathname-defaults*
  587. X        (pathname "/net/hplfs2/users/kempf/public/cool/")
  588. X    
  589. X)
  590. X
  591. X(defvar *co-files*
  592. X  (let ((xxx-low (or #+KCL       'kcl-low  ; placeholder
  593. X             #+HP        'hp-low
  594. X             nil)))
  595. X    ;; file         load           compile         files which force
  596. X    ;;              environment    environment     recompilations of
  597. X    ;;                                             this file
  598. X    `(
  599. X      (pcl-patches  nil             nil            nil)
  600. X      (co-macros    t               (pcl-patches
  601. X                    (co-macros :source))  (pcl-patches))
  602. X      (co-dmeth     t               (co-macros
  603. X                     pcl-patches)
  604. X                                               (co-macros pcl-patches))
  605. X      (co-meta      t               (co-macros
  606. X                     pcl-patches
  607. X                    (co-meta :source))
  608. X                           (co-macros pcl-patches))
  609. X      (co-dtype     t               (co-macros
  610. X                     pcl-patches)  (co-macros pcl-patches))
  611. X      (co-sfun      t               (co-macros
  612. X                     pcl-patches)  (co-macros))
  613. X    )))
  614. X
  615. X(defmacro wrong-pcl-version? () 
  616. X  '(not (string-equal "2/24/87" pcl::*pcl-system-date*)))
  617. X
  618. X(defmacro error-wrong-pcl ()
  619. X  '(error 
  620. X"This version of CommonObjects will only run with
  621. XPortable CommonLoops Version 'System Date 2/24/87'.
  622. XThis version of PCL may be obtained by sending mail
  623. Xto commonobjects-request@hplabs.hp.com"))
  624. X
  625. X(defun load-co (&optional (sources-p nil))
  626. X  (when (wrong-pcl-version?) (error-wrong-pcl))
  627. X  (pcl::load-system
  628. X    (if sources-p :sources :load) *co-files* *co-pathname-defaults*)
  629. X  (provide "co"))
  630. X
  631. X(defun compile-co (&optional (force-p nil))
  632. X  (when (wrong-pcl-version?) (error-wrong-pcl))
  633. X  (pcl::load-system 
  634. X      (if force-p ':force ':compile) *co-files* *co-pathname-defaults*))
  635. X
  636. X(defun run-tests ()
  637. X  (load "co-test.l")
  638. X  (load "co-regress.l")
  639. X)
  640. X
  641. X;;; end of co-defsys.l ;;;;;
  642. X
  643. END_OF_FILE
  644. if test 4339 -ne `wc -c <'co-defsys.l'`; then
  645.     echo shar: \"'co-defsys.l'\" unpacked with wrong size!
  646. fi
  647. # end of 'co-defsys.l'
  648. fi
  649. if test -f 'compat.l' -a "${1}" != "-c" ; then 
  650.   echo shar: Will not clobber existing file \"'compat.l'\"
  651. else
  652. echo shar: Extracting \"'compat.l'\" \(1942 characters\)
  653. sed "s/^X//" >'compat.l' <<'END_OF_FILE'
  654. X;;;-*-Mode:LISP; Package: PCL; Base:10; Syntax:Common-lisp; -*-
  655. X;;;
  656. X;;; *************************************************************************
  657. X;;; Copyright (c) 1985 Xerox Corporation.  All rights reserved.
  658. X;;;
  659. X;;; Use and copying of this software and preparation of derivative works
  660. X;;; based upon this software are permitted.  Any distribution of this
  661. X;;; software or derivative works must comply with all applicable United
  662. X;;; States export control laws.
  663. X;;; 
  664. X;;; This software is made available AS IS, and Xerox Corporation makes no
  665. X;;; warranty about the software, its performance or its conformity to any
  666. X;;; specification.
  667. X;;; 
  668. X;;; Any person obtaining a copy of this software is requested to send their
  669. X;;; name and post office or electronic mail address to:
  670. X;;;   CommonLoops Coordinator
  671. X;;;   Xerox Artifical Intelligence Systems
  672. X;;;   2400 Hanover St.
  673. X;;;   Palo Alto, CA 94303
  674. X;;; (or send Arpanet mail to CommonLoops-Coordinator.pa@Xerox.arpa)
  675. X;;;
  676. X;;; Suggestions, comments and requests for improvements are also welcome.
  677. X;;; *************************************************************************
  678. X;;;
  679. X
  680. X(in-package 'pcl)
  681. X
  682. X(defmacro run-super () '(call-next-method))
  683. X
  684. X
  685. X(defun convert-with-first-arg (first-arg use-slot-value)
  686. X  (iterate ((opc in first-arg))
  687. X    (or (listp opc) (setq opc (list opc)))
  688. X    (collect
  689. X      ;; Can't use the obvious backquote in Genera!
  690. X      (let ((entry ()))
  691. X    (when use-slot-value
  692. X      (push t entry)
  693. X      (push :use-slot-value entry))
  694. X    (when (cddr opc)
  695. X      (push (caddr opc) entry)
  696. X      (push :class entry))
  697. X    (when (cadr opc)
  698. X      (push (cadr opc) entry)
  699. X      (push :prefix entry))
  700. X    (cons (car opc) entry)))))
  701. X
  702. X(defmacro with (objects-prefixes-and-classes &body body)
  703. X  `(with-slots ,(convert-with-first-arg objects-prefixes-and-classes nil)
  704. X     . ,body))
  705. X
  706. X(defmacro with* (objects-prefixes-and-classes &body body)
  707. X  `(with-slots ,(convert-with-first-arg objects-prefixes-and-classes t)
  708. X     . ,body))
  709. X
  710. END_OF_FILE
  711. if test 1942 -ne `wc -c <'compat.l'`; then
  712.     echo shar: \"'compat.l'\" unpacked with wrong size!
  713. fi
  714. # end of 'compat.l'
  715. fi
  716. if test -f 'compile-it.sh' -a "${1}" != "-c" ; then 
  717.   echo shar: Will not clobber existing file \"'compile-it.sh'\"
  718. else
  719. echo shar: Extracting \"'compile-it.sh'\" \(410 characters\)
  720. sed "s/^X//" >'compile-it.sh' <<'END_OF_FILE'
  721. X#!/bin/sh
  722. X# Load CommonLoops, compile and test COOL.
  723. X
  724. XCL=${CL-'/lisp/bin/cl'}  # change this to point to your local
  725. X                         # Common Lisp
  726. XPCL=${PCL-'/net/hplfs2/users/kempf/public/pcl'}
  727. X
  728. Xecho "Compiling Portable CommonLoops"
  729. X$CL <<EOF
  730. X#+HP(compile-file "defsys.l")
  731. X#-HP(compile-file "defsys.lsp")
  732. X(load "defsys")
  733. X(pcl::compile-pcl)
  734. X(sys::exit)
  735. XEOF
  736. X
  737. Xecho "Done Compiling Portable CommonLoops"
  738. X
  739. END_OF_FILE
  740. if test 410 -ne `wc -c <'compile-it.sh'`; then
  741.     echo shar: \"'compile-it.sh'\" unpacked with wrong size!
  742. fi
  743. # end of 'compile-it.sh'
  744. fi
  745. if test -f 'excl-low.l' -a "${1}" != "-c" ; then 
  746.   echo shar: Will not clobber existing file \"'excl-low.l'\"
  747. else
  748. echo shar: Extracting \"'excl-low.l'\" \(3881 characters\)
  749. sed "s/^X//" >'excl-low.l' <<'END_OF_FILE'
  750. X;;; -*- Mode:LISP; Package:(PCL LISP 1000); Base:10; Syntax:Common-lisp -*-
  751. X;;;
  752. X;;; *************************************************************************
  753. X;;; Copyright (c) 1985 Xerox Corporation.  All rights reserved.
  754. X;;;
  755. X;;; Use and copying of this software and preparation of derivative works
  756. X;;; based upon this software are permitted.  Any distribution of this
  757. X;;; software or derivative works must comply with all applicable United
  758. X;;; States export control laws.
  759. X;;; 
  760. X;;; This software is made available AS IS, and Xerox Corporation makes no
  761. X;;; warranty about the software, its performance or its conformity to any
  762. X;;; specification.
  763. X;;; 
  764. X;;; Any person obtaining a copy of this software is requested to send their
  765. X;;; name and post office or electronic mail address to:
  766. X;;;   CommonLoops Coordinator
  767. X;;;   Xerox Artifical Intelligence Systems
  768. X;;;   2400 Hanover St.
  769. X;;;   Palo Alto, CA 94303
  770. X;;; (or send Arpanet mail to CommonLoops-Coordinator.pa@Xerox.arpa)
  771. X;;;
  772. X;;; Suggestions, comments and requests for improvements are also welcome.
  773. X;;; *************************************************************************
  774. X;;; 
  775. X;;; This is the EXCL (Franz) lisp version of the file portable-low.
  776. X;;; 
  777. X;;; This is for version 1.1.2.  Many of the special symbols now in the lisp
  778. X;;; package (e.g. lisp::pointer-to-fixnum) will be in some other package in
  779. X;;; a later release so this will need to be changed.
  780. X;;; 
  781. X
  782. X(in-package 'pcl)
  783. X
  784. X(eval-when (load)
  785. X  (setq *class-of*
  786. X    '(lambda (x) 
  787. X       (or (and (%instancep x)
  788. X            (%instance-class-of x))           
  789. X          ;(%funcallable-instance-p x)
  790. X           (and (stringp x) (class-named 'string))
  791. X           (class-named (type-of x) t))))
  792. X  )
  793. X
  794. X(defmacro load-time-eval (form)
  795. X  (cond ((and sys:*macroexpand-for-compiler* sys:*compile-to-core*)
  796. X     `',(eval form))
  797. X    ((and sys:*macroexpand-for-compiler* sys:*compile-to-file*)
  798. X    ;(cerror "go ahead" "called load-time-eval in compile-to-file")
  799. X     `'(,compiler::*eval-when-load-marker* . ,form))
  800. X    (t
  801. X     `(progn ,form))))
  802. X
  803. X(eval-when (compile load eval)
  804. X  (unless (fboundp 'excl::sy_hash)
  805. X    (setf (symbol-function 'excl::sy_hash)
  806. X      (symbol-function 'excl::_sy_hash-value))))
  807. X
  808. X(defmacro symbol-cache-no (symbol mask)
  809. X  (if (and (constantp symbol)
  810. X       (constantp mask))
  811. X      `(load-time-eval (logand (ash (excl::sy_hash ',symbol) -1) ,mask))
  812. X      `(logand (ash (the fixnum (excl::pointer-to-fixnum ,symbol)) -1)
  813. X           (the fixnum ,mask))))
  814. X
  815. X(defmacro object-cache-no (object mask)
  816. X  `(logand (the fixnum (excl::pointer-to-fixnum ,object))
  817. X       (the fixnum ,mask)))
  818. X
  819. X(defun printing-random-thing-internal (thing stream)
  820. X  (format stream "~O" (excl::pointer-to-fixnum thing)))
  821. X
  822. X
  823. X(defun function-arglist (f)
  824. X  (excl::arglist f))
  825. X
  826. X
  827. X(defun symbol-append (sym1 sym2 &optional (package *package*))
  828. X   ;; This is a version of symbol-append from macros.cl
  829. X   ;; It insures that all created symbols are of one case and that
  830. X   ;; case is the current prefered case.
  831. X   ;; This special version of symbol-append is not necessary if all you
  832. X   ;; want to do is compile and run pcl in a case-insensitive-upper 
  833. X   ;; version of cl.  
  834. X   ;;
  835. X   (let ((string (string-append sym1 sym2)))
  836. X      (case excl::*current-case-mode*
  837. X     ((:case-insensitive-lower :case-sensitive-lower)
  838. X      (setq string (string-downcase string)))
  839. X     ((:case-insensitive-upper :case-sensitive-upper)
  840. X      (setq string (string-upcase string))))
  841. X      (intern string package)))
  842. X
  843. X;(eval-when (compile load eval)
  844. X;  (let ((consts 
  845. X;      (sys:memref (symbol-function 'compiler::pa-macrolet)
  846. X;              (compiler::mdparam 'compiler::md-function-constant-adj)
  847. X;              0
  848. X;              :lisp)))
  849. X;    (dotimes (i (length consts))
  850. X;      (cond ((eq 'compiler::macro (svref consts i))
  851. X;         (setf (svref consts i) 'excl::macro)
  852. X;         (format t "fixed in slot ~s~%" i))
  853. X;        ((eq 'excl::macro (svref consts i))
  854. X;         (format t "already fixed in slot ~s~%" i))))))
  855. X
  856. END_OF_FILE
  857. if test 3881 -ne `wc -c <'excl-low.l'`; then
  858.     echo shar: \"'excl-low.l'\" unpacked with wrong size!
  859. fi
  860. # end of 'excl-low.l'
  861. fi
  862. if test -f 'hp-low.l' -a "${1}" != "-c" ; then 
  863.   echo shar: Will not clobber existing file \"'hp-low.l'\"
  864. else
  865. echo shar: Extracting \"'hp-low.l'\" \(3874 characters\)
  866. sed "s/^X//" >'hp-low.l' <<'END_OF_FILE'
  867. X;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  868. X;
  869. X; File:         new-hp-low.l
  870. X; SCCS:         %A% %G% %U%
  871. X; Description:  Revised hp-low.l
  872. X; Author:       James Kempf, HP/DCC
  873. X; Created:      16-Jul-86
  874. X; Modified:     26-Feb-87 13:35:43 (James Kempf)
  875. X; Language:     Lisp
  876. X; Package:      USER
  877. X; Status:       Experimental (Do Not Distribute)
  878. X;
  879. X; (c) Copyright 1986, James Kempf, all rights reserved.
  880. X;
  881. X;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  882. X
  883. X;;; -*- Mode:LISP; Package:(PCL LISP 1000); Base:10; Syntax:Common-lisp -*-
  884. X;;;
  885. X;;; *************************************************************************
  886. X;;; Copyright (c) 1985 Xerox Corporation.  All rights reserved.
  887. X;;;
  888. X;;; Use and copying of this software and preparation of derivative works
  889. X;;; based upon this software are permitted.  Any distribution of this
  890. X;;; software or derivative works must comply with all applicable United
  891. X;;; States export control laws.
  892. X;;; 
  893. X;;; This software is made available AS IS, and Xerox Corporation makes no
  894. X;;; warranty about the software, its performance or its conformity to any
  895. X;;; specification.
  896. X;;; 
  897. X;;; Any person obtaining a copy of this software is requested to send their
  898. X;;; name and post office or electronic mail address to:
  899. X;;;   CommonLoops Coordinator
  900. X;;;   Xerox Artifical Intelligence Systems
  901. X;;;   2400 Hanover St.
  902. X;;;   Palo Alto, CA 94303
  903. X;;; (or send Arpanet mail to CommonLoops-Coordinator.pa@Xerox.arpa)
  904. X;;;
  905. X;;; Suggestions, comments and requests for improvements are also welcome.
  906. X;;; *************************************************************************
  907. X;;; 
  908. X;;; This is the HP Common Lisp version of the file low.
  909. X;;;
  910. X;;; 
  911. X
  912. X(in-package 'pcl)
  913. X
  914. X  ;;   
  915. X;;;;;; Load Time Eval
  916. X  ;;
  917. X;;;
  918. X;;; #, is woefully inadequate.  You can't use it inside of a macro and have
  919. X;;; the expansion of part of the macro be evaluated at load-time its kind of
  920. X;;; a joke.  load-time-eval is used to provide an interface to implementation
  921. X;;; dependent implementation of load time evaluation.
  922. X;;;
  923. X;;; A compiled call to load-time-eval:
  924. X;;;   should evaluated the form at load time,
  925. X;;;   but if it is being compiled-to-core evaluate it at compile time
  926. X;;; Interpreted calls to load-time-eval:
  927. X;;;   should just evaluate form at run-time.
  928. X;;; 
  929. X;;; The portable implementation just evaluates it every time, and PCL knows
  930. X;;; this.  PCL is careful to only use load-time-eval in places where (except
  931. X;;; for performance penalty) it is OK to evaluate the form every time.
  932. X;;; 
  933. X;;(defmacro load-time-eval (form)
  934. X;;  `(progn ,form))
  935. X;;(defmacro load-time-eval (form)
  936. X;;   `(impl::loadtime ,form))
  937. X
  938. X(defmacro load-time-eval (form)
  939. X  `(eval-when (load eval) ,form))  
  940. X
  941. X
  942. X(setq *class-of*
  943. X    '(lambda (x) 
  944. X       (cond ((%instancep x)
  945. X          (%instance-class-of x))
  946. X         ;; Ports of PCL should define the rest of class-of
  947. X         ;; more meaningfully.  Because of the underspecification
  948. X                 ;; of type-of this is the best that I can do.
  949. X         ((null x)
  950. X                  (class-named 'null))
  951. X                 ((stringp x)
  952. X                  (class-named 'string))
  953. X         ((characterp x)
  954. X          (class-named 'character))
  955. X         (t
  956. X          (or (class-named (type-of x) t)
  957. X              (error "Can't determine class of ~S." x)
  958. X          )
  959. X        )
  960. X            )
  961. X        )
  962. X)
  963. X
  964. X(eval-when (load eval)
  965. X  (recompile-class-of)
  966. X)
  967. X  ;;   
  968. X;;;;;; Cache No's
  969. X  ;;  
  970. X
  971. X;;; Grab the top 29 bits
  972. X;;;
  973. X(defmacro symbol-cache-no (symbol mask)
  974. X;`(logand (prim:@inf ,symbol) ,mask)            ;    33% hit rate
  975. X  `(logand (ash (prim:@inf ,symbol) -5) ,mask))        ;    83% hit rate
  976. X;   `(the extn::index (logand (prim::@>> ,symbol 4) ,mask)))  ; 75% hit rate
  977. X
  978. X(defmacro object-cache-no (symbol mask)
  979. X  `(logand (ash (prim:@inf ,symbol) -5) ,mask))
  980. X
  981. X  ;;   
  982. X;;;;;; printing-random-thing-internal
  983. X  ;;
  984. X(defun printing-random-thing-internal (thing stream)
  985. X  (format stream "~O" (prim:@inf thing)))
  986. X
  987. X
  988. END_OF_FILE
  989. if test 3874 -ne `wc -c <'hp-low.l'`; then
  990.     echo shar: \"'hp-low.l'\" unpacked with wrong size!
  991. fi
  992. # end of 'hp-low.l'
  993. fi
  994. if test -f 'kcl-low.l' -a "${1}" != "-c" ; then 
  995.   echo shar: Will not clobber existing file \"'kcl-low.l'\"
  996. else
  997. echo shar: Extracting \"'kcl-low.l'\" \(2844 characters\)
  998. sed "s/^X//" >'kcl-low.l' <<'END_OF_FILE'
  999. X;;; -*- Mode: LISP; Syntax: Common-lisp; Package: (PCL Lisp 1000); Base: 10. -*-
  1000. X;;;
  1001. X;;; *************************************************************************
  1002. X;;; Copyright (c) 1985 Xerox Corporation.  All rights reserved.
  1003. X;;;
  1004. X;;; Use and copying of this software and preparation of derivative works
  1005. X;;; based upon this software are permitted.  Any distribution of this
  1006. X;;; software or derivative works must comply with all applicable United
  1007. X;;; States export control laws.
  1008. X;;; 
  1009. X;;; This software is made available AS IS, and Xerox Corporation makes no
  1010. X;;; warranty about the software, its performance or its conformity to any
  1011. X;;; specification.
  1012. X;;; 
  1013. X;;; Any person obtaining a copy of this software is requested to send their
  1014. X;;; name and post office or electronic mail address to:
  1015. X;;;   CommonLoops Coordinator
  1016. X;;;   Xerox Artifical Intelligence Systems
  1017. X;;;   2400 Hanover St.
  1018. X;;;   Palo Alto, CA 94303
  1019. X;;; (or send Arpanet mail to CommonLoops-Coordinator.pa@Xerox.arpa)
  1020. X;;;
  1021. X;;; Suggestions, comments and requests for improvements are also welcome.
  1022. X;;; *************************************************************************
  1023. X;;;
  1024. X;;; The version of low for Kyoto Common Lisp (KCL)
  1025. X(in-package 'pcl)
  1026. X
  1027. X  ;;   
  1028. X;;;;;; Load Time Eval
  1029. X  ;;
  1030. X;;; 
  1031. X
  1032. X;;; This doesn't work because it looks at a global variable to see if it is
  1033. X;;; in the compiler rather than looking at the macroexpansion environment.
  1034. X;;; 
  1035. X;;; The result is that if in the process of compiling a file, we evaluate a
  1036. X;;; form that has a call to load-time-eval, we will get faked into thinking
  1037. X;;; that we are compiling that form.
  1038. X;;;
  1039. X;;; THIS NEEDS TO BE DONE RIGHT!!!
  1040. X;;; 
  1041. X;(defmacro load-time-eval (form)
  1042. X;  ;; In KCL there is no compile-to-core case.  For things that we are 
  1043. X;  ;; "compiling to core" we just expand the same way as if were are
  1044. X;  ;; compiling a file since the form will be evaluated in just a little
  1045. X;  ;; bit when gazonk.o is loaded.
  1046. X;  (if (and (boundp 'compiler::*compiler-input*)  ;Hack to see of we are
  1047. X;       compiler::*compiler-input*)          ;in the compiler!
  1048. X;      `'(si:|#,| . ,form)
  1049. X;      `(progn ,form)))
  1050. X
  1051. X
  1052. X  ;;   
  1053. X;;;;;; The %instance datastructure.
  1054. X  ;;   
  1055. X
  1056. X
  1057. X  ;;   
  1058. X;;;;;; Generating CACHE numbers
  1059. X  ;;
  1060. X;;; This needs more work to be sure it is going as fast as possible.
  1061. X;;;   -  The calls to si:address should be open-coded.
  1062. X;;;   -  The logand should be open coded.
  1063. X;;;   
  1064. X
  1065. X(defmacro symbol-cache-no (symbol mask)
  1066. X  (if (and (constantp symbol)
  1067. X       (constantp mask))
  1068. X      `(load-time-eval (logand (ash (si:address ,symbol) -2) ,mask))
  1069. X      `(logand (ash (the fixnum (si:address ,symbol)) -2) ,mask)))
  1070. X
  1071. X(defmacro object-cache-no (object mask)
  1072. X  `(logand (the fixnum (si:address ,object)) ,mask))
  1073. X
  1074. X  ;;   
  1075. X;;;;;; printing-random-thing-internal
  1076. X  ;;
  1077. X(defun printing-random-thing-internal (thing stream)
  1078. X  (format stream "~O" (si:address thing)))
  1079. X
  1080. X
  1081. END_OF_FILE
  1082. if test 2844 -ne `wc -c <'kcl-low.l'`; then
  1083.     echo shar: \"'kcl-low.l'\" unpacked with wrong size!
  1084. fi
  1085. # end of 'kcl-low.l'
  1086. fi
  1087. if test -f 'lucid-low.l' -a "${1}" != "-c" ; then 
  1088.   echo shar: Will not clobber existing file \"'lucid-low.l'\"
  1089. else
  1090. echo shar: Extracting \"'lucid-low.l'\" \(3690 characters\)
  1091. sed "s/^X//" >'lucid-low.l' <<'END_OF_FILE'
  1092. X;;; -*- Mode:LISP; Package:(PCL LISP 1000); Base:10; Syntax:Common-lisp -*-
  1093. X;;;
  1094. X;;; *************************************************************************
  1095. X;;; Copyright (c) 1985 Xerox Corporation.  All rights reserved.
  1096. X;;;
  1097. X;;; Use and copying of this software and preparation of derivative works
  1098. X;;; based upon this software are permitted.  Any distribution of this
  1099. X;;; software or derivative works must comply with all applicable United
  1100. X;;; States export control laws.
  1101. X;;; 
  1102. X;;; This software is made available AS IS, and Xerox Corporation makes no
  1103. X;;; warranty about the software, its performance or its conformity to any
  1104. X;;; specification.
  1105. X;;; 
  1106. X;;; Any person obtaining a copy of this software is requested to send their
  1107. X;;; name and post office or electronic mail address to:
  1108. X;;;   CommonLoops Coordinator
  1109. X;;;   Xerox Artifical Intelligence Systems
  1110. X;;;   2400 Hanover St.
  1111. X;;;   Palo Alto, CA 94303
  1112. X;;; (or send Arpanet mail to CommonLoops-Coordinator.pa@Xerox.arpa)
  1113. X;;;
  1114. X;;; Suggestions, comments and requests for improvements are also welcome.
  1115. X;;; *************************************************************************
  1116. X;;; 
  1117. X;;; This is the Lucid lisp version of the file portable-low.
  1118. X;;;
  1119. X;;; Lucid:               (415)329-8400
  1120. X;;; Sun:     Steve Gadol (415)960-1300
  1121. X;;; 
  1122. X
  1123. X(in-package 'pcl)
  1124. X
  1125. X  ;;   
  1126. X;;;;;; Memory Block primitives.
  1127. X  ;;   
  1128. X
  1129. X(defmacro make-memory-block (size &optional area)
  1130. X  (ignore area)
  1131. X  `(make-array ,size))
  1132. X
  1133. X;;;
  1134. X;;; Reimplementation OF %INSTANCE
  1135. X;;;
  1136. X;;; We take advantage of the fact that Lucid defstruct doesn't depend on
  1137. X;;; the fact that Common Lisp defstructs are fixed length.  This allows us to
  1138. X;;; use defstruct to define a new type, but use internal structure allocation
  1139. X;;; code to make structure of that type of any length we like.
  1140. X;;;
  1141. X;;; In our %instance datatype, the array look like
  1142. X;;;
  1143. X;;;  structure type: The symbol %INSTANCE, this tells the system what kind
  1144. X;;;                  of structure this is.
  1145. X;;;  element 0:      The meta-class of this %INSTANCE
  1146. X;;;  element 1:      This is used to store the value of %instance-ref slot 0.
  1147. X;;;  element 2:      This is used to store the value of %instance-ref slot 1.
  1148. X;;;     .                                .
  1149. X;;;     .                                .
  1150. X;;;
  1151. X(defstruct (%instance (:print-function print-instance)
  1152. X              (:constructor nil)
  1153. X              (:predicate %instancep))
  1154. X  meta-class)
  1155. X
  1156. X(defmacro %make-instance (meta-class size)
  1157. X  (let ((instance-var (gensym)))
  1158. X    `(let ((,instance-var (lucid::new-structure (1+ ,size) '%instance)))
  1159. X       (setf (lucid::structure-ref ,instance-var 0 '%instance) ,meta-class)
  1160. X       ,instance-var)))
  1161. X
  1162. X(defmacro %instance-ref (instance index)
  1163. X  `(lucid::structure-ref ,instance (1+ ,index) '%instance))
  1164. X
  1165. X
  1166. X  ;;   
  1167. X;;;;;; Cache No's
  1168. X  ;;  
  1169. X
  1170. X;;; Grab the top 29 bits
  1171. X;;;
  1172. X(lucid::defsubst symbol-cache-no (symbol mask)
  1173. X  (logand (lucid::%field symbol 3 29) mask))
  1174. X
  1175. X;;; Same here
  1176. X;;;
  1177. X(lucid::defsubst object-cache-no (object mask)
  1178. X  (logand (lucid::%field object 3 29) mask))
  1179. X
  1180. X  ;;   
  1181. X;;;;;; printing-random-thing-internal
  1182. X  ;;
  1183. X(defun printing-random-thing-internal (thing stream)
  1184. X  (format stream "~O" (lucid::%pointer thing)))
  1185. X
  1186. X
  1187. X(in-package 'lucid)
  1188. X
  1189. X(defun output-structure (struct currlevel)
  1190. X  (let ((type (structure-type struct)))
  1191. X    (multiple-value-bind (length struct-type constructor print-function)
  1192. X    (defstruct-info type)
  1193. X      (declare (ignore struct-type constructor))
  1194. X      (if (not *print-structure*)
  1195. X      (output-terse-object struct
  1196. X                   (if (streamp struct) "Stream" "Structure")
  1197. X                   type)
  1198. X      (funcall (if print-function
  1199. X               (symbol-function print-function)
  1200. X               #'default-structure-print)
  1201. X           struct *print-output* currlevel)))))
  1202. X
  1203. END_OF_FILE
  1204. if test 3690 -ne `wc -c <'lucid-low.l'`; then
  1205.     echo shar: \"'lucid-low.l'\" unpacked with wrong size!
  1206. fi
  1207. # end of 'lucid-low.l'
  1208. fi
  1209. if test -f 'ntype-of.l' -a "${1}" != "-c" ; then 
  1210.   echo shar: Will not clobber existing file \"'ntype-of.l'\"
  1211. else
  1212. echo shar: Extracting \"'ntype-of.l'\" \(3698 characters\)
  1213. sed "s/^X//" >'ntype-of.l' <<'END_OF_FILE'
  1214. X;;;-*- Mode:LISP; Package: (ntype-of lisp); Base:10; Syntax:Common-lisp -*-
  1215. X;;;
  1216. X;;; *************************************************************************
  1217. X;;; Copyright (c) 1985 Xerox Corporation.  All rights reserved.
  1218. X;;;
  1219. X;;; Use and copying of this software and preparation of derivative works
  1220. X;;; based upon this software are permitted.  Any distribution of this
  1221. X;;; software or derivative works must comply with all applicable United
  1222. X;;; States export control laws.
  1223. X;;; 
  1224. X;;; This software is made available AS IS, and Xerox Corporation makes no
  1225. X;;; warranty about the software, its performance or its conformity to any
  1226. X;;; specification.
  1227. X;;; 
  1228. X;;; Any person obtaining a copy of this software is requested to send their
  1229. X;;; name and post office or electronic mail address to:
  1230. X;;;   CommonLoops Coordinator
  1231. X;;;   Xerox Artifical Intelligence Systems
  1232. X;;;   2400 Hanover St.
  1233. X;;;   Palo Alto, CA 94303
  1234. X;;; (or send Arpanet mail to CommonLoops-Coordinator.pa@Xerox.arpa)
  1235. X;;;
  1236. X;;; Suggestions, comments and requests for improvements are also welcome.
  1237. X;;; *************************************************************************
  1238. X;;;
  1239. X
  1240. X(in-package 'ntype-of)
  1241. X
  1242. X(defvar *portable-types*
  1243. X  `(number
  1244. X    (ratio 1/2)
  1245. X    (complex #c(1 2) complexp)
  1246. X    ((integer fixnum bignum) 1 integerp)
  1247. X    ((float short-float single-float double-float long-float) 1.1 floatp)
  1248. X    (null () null)
  1249. X    ((character standard-char string-char) #\a characterp)
  1250. X    (simple-bit-vector #*101 simple-bit-vector-p)
  1251. X    (bit-vector ,(make-array 3 :element-type 'bit) bit-vector-p)
  1252. X    (simple-array ,(make-array 10))
  1253. X    (string ,(make-string 3) stringp)
  1254. X    (simple-vector #(1 2 3))
  1255. X    (array (make-array 3 :displaced-to (make-array 3)) arrayp)
  1256. X    ))
  1257. X
  1258. X(defvar *portable-types*
  1259. X  `(t
  1260. X    (array (make-array 3 :displaced-to (make-array 3)) arrayp)
  1261. X    (simple-bit-vector #*101 simple-bit-vector-p)
  1262. X    (bit-vector ,(make-array 3 :element-type 'bit) bit-vector-p)
  1263. X    (simple-array ,(make-array 10))
  1264. X    ))
  1265. X
  1266. X(defvar *portable-type-lattice*)
  1267. X
  1268. X(defstruct (node (:conc-name node-)
  1269. X         (:constructor make-node (type entry))
  1270. X         (:print-function
  1271. X           (lambda (node stream d)
  1272. X             (declare (ignore d))
  1273. X             (format stream "#<node ~S ~:S ~:S>"
  1274. X                 (node-type node)
  1275. X                 (mapcar #'node-type (node-supers node))
  1276. X                 (mapcar #'node-type (node-subs node))))))
  1277. X  type
  1278. X  supers
  1279. X  subs
  1280. X  entry)
  1281. X
  1282. X(defun make-type-lattice ()
  1283. X  (macrolet ((memq (x l) `(member ,x ,l :test #'eq))
  1284. X         (delq (x l) `(delete ,x ,l :test #'eq)))
  1285. X    (flet ((entry-type (entry)                    ;type of an element 
  1286. X         (cond ((symbolp entry) entry)            ;of *portable-types*
  1287. X           ((symbolp (car entry)) (car entry))    
  1288. X           (t (caar entry))))
  1289. X       (add-super (node super)
  1290. X         (setf (node-supers node) (cons super (node-supers node))
  1291. X           (node-subs super) (cons node (node-subs super))))     
  1292. X       (remove-super (node super)
  1293. X         (setf (node-supers node) (delq super (node-supers node))
  1294. X           (node-subs super) (delq node (node-subs super)))))
  1295. X      (let ((nodes (mapcar #'(lambda (entry)
  1296. X                   (make-node (entry-type entry) entry))
  1297. X               *portable-types*)))
  1298. X    (setq *portable-type-lattice* (find 't nodes :key #'node-type))
  1299. X    (dolist (n1 nodes)
  1300. X      (dolist (n2 (cdr (memq n1 nodes)))
  1301. X        (cond ((subtypep (node-type n1) (node-type n2))
  1302. X           (add-super n1 n2))
  1303. X          ((subtypep (node-type n2) (node-type n1))
  1304. X           (add-super n2 n1)))))
  1305. X    (dolist (node nodes)
  1306. X      (dolist (super1 (node-supers node))
  1307. X        (dolist (super2 (cdr (node-supers node)))
  1308. X          (unless (eq super1 super2)
  1309. X        (when (subtypep (node-type super1) (node-type super2))
  1310. X          (remove-super node super2))))))
  1311. X    nodes))))
  1312. X
  1313. X(defun prune-type-lattice (lattice subs)
  1314. X  (cond ((null subs) nil)
  1315. X    (
  1316. X
  1317. X     )))
  1318. X
  1319. END_OF_FILE
  1320. if test 3698 -ne `wc -c <'ntype-of.l'`; then
  1321.     echo shar: \"'ntype-of.l'\" unpacked with wrong size!
  1322. fi
  1323. # end of 'ntype-of.l'
  1324. fi
  1325. if test -f 'semantics.asci' -a "${1}" != "-c" ; then 
  1326.   echo shar: Will not clobber existing file \"'semantics.asci'\"
  1327. else
  1328. echo shar: Extracting \"'semantics.asci'\" \(2675 characters\)
  1329. sed "s/^X//" >'semantics.asci' <<'END_OF_FILE'
  1330. X
  1331. X    Semantic Changes for CommonObjects
  1332. X      on CommonLoops (COOL)
  1333. X
  1334. X
  1335. X1) It is not possible to have seperately defined methods
  1336. X   inherited if the methods and the child types are
  1337. X   defined in the same file as the parent. Methods which are generated
  1338. X   by the parent type definition are inheritable, however.
  1339. X   In general, defining parent types and methods and 
  1340. X   child types and methods in seperate files is a good idea.
  1341. X   The parent types and methods must be defined in the
  1342. X   compile time environment of the child.
  1343. X
  1344. X2) The universal methods :PRINT, :DESCRIBE, :TYPEP, :COPY,
  1345. X   :COPY-INSTANCE, :COPY-STATE, :EQL, :EQUAL, :EQUALP
  1346. X   :INIT, and :INITIALIZE
  1347. X   are defined in common for all CommonObjects types. The
  1348. X   user can redefine these methods for a particular type, 
  1349. X   but cannot undefine them if the type uses the default 
  1350. X   method. A warning message is issued if the user tries
  1351. X   to undefine a default universal method.
  1352. X
  1353. X3) SELF is SETF-able within a method. SELF will also
  1354. X   be accepted as an instance variable name.
  1355. X
  1356. X4) The :VARIABLES suboption for inheritence is not
  1357. X   supported. Trying to use it will cause an error
  1358. X   during type definition.
  1359. X
  1360. X5) The :TYPE suboption of :VAR has no effect. It
  1361. X   may be included (for documentation purposes)
  1362. X   and will not cause an error to be signalled.
  1363. X
  1364. X6) An instance variable named SET-x and an
  1365. X   instance variable named x which is declared
  1366. X   settable in the same type cause no warning
  1367. X   message to be generated.
  1368. X
  1369. X7) Types are fully defined at compile time (minus
  1370. X   generated methods). Compiling a type will thus
  1371. X   cause a defined type in the environment to be
  1372. X   trashed. The actual time when the type is defined
  1373. X   is during expansion of the DEFINE-TYPE macro.
  1374. X
  1375. X8) In order to have the universal methods invoked for 
  1376. X   the Lisp functions TYPEP, EQL, EQUAL, and EQUALP
  1377. X   and have TYPE-OF return the CommonObjects type
  1378. X   rather than the Lisp type for a CommonObjects
  1379. X   object, the macro CO:IMPORT-SPECIALIZED-FUNCTIONS
  1380. X   must be invoked in the package where CommonObjects
  1381. X   is to be used. Special functions which shadow the
  1382. X   defined Lisp functions are used to avoid problems
  1383. X   with infinite recursion and excessive CONSing
  1384. X   which may otherwise result. In addition, the 
  1385. X   default universal method for TYPEP does not
  1386. X   signal an error when an undefined type name
  1387. X   is given.
  1388. X
  1389. X9) The argument lists of methods with the same
  1390. X   name on different types must match. The
  1391. X   exact rules for argument conformity are
  1392. X   outlined in the Common Lisp Object System
  1393. X   document (the proposed standard) but for purposes
  1394. X   of COOL, the lists must have the same number
  1395. X   of required, &REST, and keyword parameters.
  1396. X
  1397. END_OF_FILE
  1398. if test 2675 -ne `wc -c <'semantics.asci'`; then
  1399.     echo shar: \"'semantics.asci'\" unpacked with wrong size!
  1400. fi
  1401. # end of 'semantics.asci'
  1402. fi
  1403. if test -f 'spice-low.l' -a "${1}" != "-c" ; then 
  1404.   echo shar: Will not clobber existing file \"'spice-low.l'\"
  1405. else
  1406. echo shar: Extracting \"'spice-low.l'\" \(2846 characters\)
  1407. sed "s/^X//" >'spice-low.l' <<'END_OF_FILE'
  1408. X;;; -*- Mode:LISP; Package:(PCL LISP 1000); Base:10; Syntax:Common-lisp -*-
  1409. X;;;
  1410. X;;; *************************************************************************
  1411. X;;; Copyright (c) 1985 Xerox Corporation.  All rights reserved.
  1412. X;;;
  1413. X;;; Use and copying of this software and preparation of derivative works
  1414. X;;; based upon this software are permitted.  Any distribution of this
  1415. X;;; software or derivative works must comply with all applicable United
  1416. X;;; States export control laws.
  1417. X;;; 
  1418. X;;; This software is made available AS IS, and Xerox Corporation makes no
  1419. X;;; warranty about the software, its performance or its conformity to any
  1420. X;;; specification.
  1421. X;;; 
  1422. X;;; Any person obtaining a copy of this software is requested to send their
  1423. X;;; name and post office or electronic mail address to:
  1424. X;;;   CommonLoops Coordinator
  1425. X;;;   Xerox Artifical Intelligence Systems
  1426. X;;;   2400 Hanover St.
  1427. X;;;   Palo Alto, CA 94303
  1428. X;;; (or send Arpanet mail to CommonLoops-Coordinator.pa@Xerox.arpa)
  1429. X;;;
  1430. X;;; Suggestions, comments and requests for improvements are also welcome.
  1431. X;;; *************************************************************************
  1432. X;;; 
  1433. X;;; This is the Spice Lisp version of the file portable-low.
  1434. X;;;
  1435. X;;; History:
  1436. X;;;    7-Dec-86
  1437. X;;;       Rick Busdiecker (rfb) at Carnegie-Mellon University
  1438. X;;;          Added suggested change from Gregor Kiczales @ Parc
  1439. X;;;    ??-???-??
  1440. X;;;      CMU:     David B. McDonald (412)268-8860
  1441. X;;;         Modified.
  1442. X;;;    ??-???-??
  1443. X;;;      Skef Wholey at Carnegie-Mellon University
  1444. X;;;         Created.
  1445. X;;;
  1446. X;;;
  1447. X;;; 
  1448. X
  1449. X(in-package 'pcl)
  1450. X
  1451. X  ;;   
  1452. X;;;;;; Cache No's
  1453. X  ;;  
  1454. X
  1455. X;;; Abuse the type declaration, but it generates great code.
  1456. X
  1457. X(defun symbol-cache-no (symbol mask)
  1458. X  (logand (the fixnum (%primitive lisp::make-immediate-type
  1459. X                  symbol
  1460. X                  system::%+-fixnum-type))
  1461. X      (the fixnum mask)))
  1462. X
  1463. X(clc::deftransform symbol-cache-no symbol-cache-no-transform (symbol mask)
  1464. X  `(logand (the fixnum (%primitive lisp::make-immediate-type
  1465. X                   ,symbol
  1466. X                   system::%+-fixnum-type))
  1467. X       (the fixnum ,mask)))
  1468. X
  1469. X(defun object-cache-no (symbol mask)
  1470. X  (logand (the fixnum (%primitive lisp::make-immediate-type
  1471. X                  symbol
  1472. X                  system::%+-fixnum-type))
  1473. X      (the fixnum mask)))
  1474. X
  1475. X(clc::deftransform object-cache-no object-cache-no-transform (symbol mask)
  1476. X  `(logand (the fixnum (%primitive make-immediate-type
  1477. X                   ,symbol
  1478. X                   system::%+-fixnum-type))
  1479. X       (the fixnum ,mask)))
  1480. X
  1481. X
  1482. X
  1483. X(eval-when (load)
  1484. X  (setq *class-of*        
  1485. X    '(lambda (x) 
  1486. X       (or (and (%instancep x)
  1487. X            (%instance-class-of x))
  1488. X          ;(%funcallable-instance-p x)
  1489. X
  1490. X           (and (null object) (class-named 'nil))
  1491. X           (and (stringp object) (class-named 'string))
  1492. X           (and (ratiop object) (class-named 'rational))
  1493. X           (and (streamp object) (class-named 'stream))
  1494. X           
  1495. X           (class-named (type-of x) t)
  1496. X           (error "Can't determine class of ~S" x)))))
  1497. X
  1498. END_OF_FILE
  1499. if test 2846 -ne `wc -c <'spice-low.l'`; then
  1500.     echo shar: \"'spice-low.l'\" unpacked with wrong size!
  1501. fi
  1502. # end of 'spice-low.l'
  1503. fi
  1504. if test -f 'sublines' -a "${1}" != "-c" ; then 
  1505.   echo shar: Will not clobber existing file \"'sublines'\"
  1506. else
  1507. echo shar: Extracting \"'sublines'\" \(274 characters\)
  1508. sed "s/^X//" >'sublines' <<'END_OF_FILE'
  1509. Xvi 3600-low.l braid.l class-prot.l class-slots.l compat.l compile-it.sh defsys.l defclass.l fixup.l fsc-low.l gfun-low.l high.l hp-low.l kcl-low.l low.l lucid-low.l macros.l meth-combi.l methods.l ntype-of.l spice-low.l test.l ti-low.l trapd.l vaxl-low.l walk.l xerox-low.l
  1510. END_OF_FILE
  1511. if test 274 -ne `wc -c <'sublines'`; then
  1512.     echo shar: \"'sublines'\" unpacked with wrong size!
  1513. fi
  1514. # end of 'sublines'
  1515. fi
  1516. if test -f 'ti-low.l' -a "${1}" != "-c" ; then 
  1517.   echo shar: Will not clobber existing file \"'ti-low.l'\"
  1518. else
  1519. echo shar: Extracting \"'ti-low.l'\" \(1881 characters\)
  1520. sed "s/^X//" >'ti-low.l' <<'END_OF_FILE'
  1521. X;;; -*- Mode:LISP; Package:(PCL Lisp 1000); Base:10.; Syntax:Common-lisp; Patch-File: Yes -*-
  1522. X;;;
  1523. X;;; *************************************************************************
  1524. X;;; Copyright (c) 1985 Xerox Corporation.  All rights reserved.
  1525. X;;;
  1526. X;;; Use and copying of this software and preparation of derivative works
  1527. X;;; based upon this software are permitted.  Any distribution of this
  1528. X;;; software or derivative works must comply with all applicable United
  1529. X;;; States export control laws.
  1530. X;;; 
  1531. X;;; This software is made available AS IS, and Xerox Corporation makes no
  1532. X;;; warranty about the software, its performance or its conformity to any
  1533. X;;; specification.
  1534. X;;; 
  1535. X;;; Any person obtaining a copy of this software is requested to send their
  1536. X;;; name and post office or electronic mail address to:
  1537. X;;;   CommonLoops Coordinator
  1538. X;;;   Xerox Artifical Intelligence Systems
  1539. X;;;   2400 Hanover St.
  1540. X;;;   Palo Alto, CA 94303
  1541. X;;; (or send Arpanet mail to CommonLoops-Coordinator.pa@Xerox.arpa)
  1542. X;;;
  1543. X;;; Suggestions, comments and requests for improvements are also welcome.
  1544. X;;; *************************************************************************
  1545. X;;;
  1546. X;;; This is the 3600 version of the file portable-low.
  1547. X;;;
  1548. X
  1549. X(in-package 'pcl)
  1550. X
  1551. X(defmacro without-interrupts (&body body)
  1552. X  `(zl:without-interrupts ,.body))
  1553. X
  1554. X  ;;   
  1555. X;;;;;; Cache No's
  1556. X  ;;  
  1557. X
  1558. X(defmacro symbol-cache-no (symbol mask)
  1559. X  `(logand (si::%pointer ,symbol) ,mask))
  1560. X
  1561. X(defmacro object-cache-no (object mask)
  1562. X  `(logand (si::%pointer ,object) ,mask))
  1563. X
  1564. X  ;;   
  1565. X;;;;;; printing-random-thing-internal
  1566. X  ;;
  1567. X(defun printing-random-thing-internal (thing stream)
  1568. X  (format stream "~O" (si:%pointer thing)))
  1569. X
  1570. X(eval-when (compile load eval)             ;There seems to be some bug with
  1571. X  (setq si::inhibit-displacing-flag t))       ;macrolet'd macros or something.
  1572. X                       ;This gets around it but its not
  1573. X                       ;really the right fix.
  1574. X
  1575. END_OF_FILE
  1576. if test 1881 -ne `wc -c <'ti-low.l'`; then
  1577.     echo shar: \"'ti-low.l'\" unpacked with wrong size!
  1578. fi
  1579. # end of 'ti-low.l'
  1580. fi
  1581. if test -f 'trapd.l' -a "${1}" != "-c" ; then 
  1582.   echo shar: Will not clobber existing file \"'trapd.l'\"
  1583. else
  1584. echo shar: Extracting \"'trapd.l'\" \(2353 characters\)
  1585. sed "s/^X//" >'trapd.l' <<'END_OF_FILE'
  1586. X;;; -*- Mode:LISP; Package:(PCL LISP 1000); Base:10; Syntax:Common-lisp -*-
  1587. X;;;
  1588. X;;; *************************************************************************
  1589. X;;; Copyright (c) 1985 Xerox Corporation.  All rights reserved.
  1590. X;;;
  1591. X;;; Use and copying of this software and preparation of derivative works
  1592. X;;; based upon this software are permitted.  Any distribution of this
  1593. X;;; software or derivative works must comply with all applicable United
  1594. X;;; States export control laws.
  1595. X;;; 
  1596. X;;; This software is made available AS IS, and Xerox Corporation makes no
  1597. X;;; warranty about the software, its performance or its conformity to any
  1598. X;;; specification.
  1599. X;;; 
  1600. X;;; Any person obtaining a copy of this software is requested to send their
  1601. X;;; name and post office or electronic mail address to:
  1602. X;;;   CommonLoops Coordinator
  1603. X;;;   Xerox Artifical Intelligence Systems
  1604. X;;;   2400 Hanover St.
  1605. X;;;   Palo Alto, CA 94303
  1606. X;;; (or send Arpanet mail to CommonLoops-Coordinator.pa@Xerox.arpa)
  1607. X;;;
  1608. X;;; Suggestions, comments and requests for improvements are also welcome.
  1609. X;;; *************************************************************************
  1610. X;;;
  1611. X;;; Trapped discriminators.
  1612. X;;;
  1613. X;;; These allow someone to declare that for a given selector, the methods
  1614. X;;; should actually be defined on some other selector, the so-called trap-
  1615. X;;; selector.
  1616. X;;;
  1617. X;;; An example of its use is:
  1618. X;;;   (make-primitive-specializable 'car 'car-trap)
  1619. X;;;
  1620. X
  1621. X(in-package 'pcl)
  1622. X
  1623. X(ndefstruct (trapped-discriminator-mixin
  1624. X          (:class class)
  1625. X          (:include discriminator)
  1626. X          (:conc-name trapped-discriminator-))
  1627. X  (trap-discriminator ()))
  1628. X
  1629. X(defmeth trapped-discriminator-selector ((self trapped-discriminator-mixin))
  1630. X  (let ((td (trapped-discriminator-trap-discriminator self)))
  1631. X    (and td (discriminator-name td))))    
  1632. X
  1633. X(defmeth add-method-internal ((self trapped-discriminator-mixin)
  1634. X                  (method basic-method))
  1635. X  (with (self) (add-method-internal trap-discriminator method)))
  1636. X
  1637. X(ndefstruct (trapped-discriminator
  1638. X          (:class class)
  1639. X          (:include (trapped-discriminator-mixin discriminator))))
  1640. X
  1641. X(defun make-primitive-specializable (name trap-selector &rest options)
  1642. X  (let ((trap-discriminator
  1643. X      (apply #'make-specializable trap-selector arglist)))
  1644. X    (setf (discriminator-named name)
  1645. X      (make 'trapped-discriminator
  1646. X        :name name
  1647. X        :trap-discriminator trap-discriminator))))
  1648. X
  1649. X
  1650. END_OF_FILE
  1651. if test 2353 -ne `wc -c <'trapd.l'`; then
  1652.     echo shar: \"'trapd.l'\" unpacked with wrong size!
  1653. fi
  1654. # end of 'trapd.l'
  1655. fi
  1656. if test -f 'vaxl-low.l' -a "${1}" != "-c" ; then 
  1657.   echo shar: Will not clobber existing file \"'vaxl-low.l'\"
  1658. else
  1659. echo shar: Extracting \"'vaxl-low.l'\" \(1932 characters\)
  1660. sed "s/^X//" >'vaxl-low.l' <<'END_OF_FILE'
  1661. X;;; -*- Mode: LISP; Syntax: Common-lisp; Package: (PCL Lisp 1000); Base: 10. -*-
  1662. X;;;
  1663. X;;; *******************************************************************************
  1664. X;;; Copyright (c) 1985 Xerox Corporation.  All rights reserved.
  1665. X;;;
  1666. X;;; Use and copying of this software and preparation of derivative works based upon
  1667. X;;; this software are permitted.  Any distribution of this software or derivative
  1668. X;;; works must comply with all applicable United States export control laws.
  1669. X;;; 
  1670. X;;; This software is made available AS IS, and Xerox Corporation makes no warranty
  1671. X;;; about the software, its performance or its conformity to any specification.
  1672. X;;; 
  1673. X;;; Any person obtaining a copy of this software is requested to send their name
  1674. X;;; and post office or electronic mail address to:
  1675. X;;;   CommonLoops Coordinator
  1676. X;;;   Xerox Artifical Intelligence Systems
  1677. X;;;   2400 Hanover St.
  1678. X;;;   Palo Alto, CA 94303
  1679. X;;; (or send Arpanet mail to CommonLoops-Coordinator.pa@Xerox.arpa)
  1680. X;;;
  1681. X;;; Suggestions, comments and requests for improvements are also welcome.
  1682. X;;; *******************************************************************************
  1683. X;;;
  1684. X;;; The version of low for VAXLisp
  1685. X(in-package 'pcl)
  1686. X
  1687. X  ;;   
  1688. X;;;;;; Load Time Eval
  1689. X  ;;
  1690. X(defmacro load-time-eval (form)
  1691. X  `(progn ,form))
  1692. X
  1693. X  ;;   
  1694. X;;;;;; Generating CACHE numbers
  1695. X  ;;
  1696. X;;; How are symbols in VAXLisp actually arranged in memory?
  1697. X;;; Should we be shifting the address?
  1698. X;;; Are they relocated?
  1699. X;;; etc.
  1700. X
  1701. X(defmacro symbol-cache-no (symbol mask)
  1702. X  `(logand (the fixnum (system::%sp-pointer->fixnum ,symbol)) ,mask))
  1703. X
  1704. X(defmacro object-cache-no (object mask)
  1705. X  `(logand (the fixnum (system::%sp-pointer->fixnum ,object)) ,mask))
  1706. X
  1707. X  ;;   
  1708. X;;;;;; printing-random-thing-internal
  1709. X  ;;
  1710. X(defun printing-random-thing-internal (thing stream)
  1711. X  (format stream "~O" (system::%sp-pointer->fixnum thing)))
  1712. X
  1713. X
  1714. X(defun function-arglist (fn)
  1715. X  (system::function-lambda-vars (symbol-function fn)))
  1716. X
  1717. END_OF_FILE
  1718. if test 1932 -ne `wc -c <'vaxl-low.l'`; then
  1719.     echo shar: \"'vaxl-low.l'\" unpacked with wrong size!
  1720. fi
  1721. # end of 'vaxl-low.l'
  1722. fi
  1723. echo shar: End of archive 1 \(of 13\).
  1724. cp /dev/null ark1isdone
  1725. MISSING=""
  1726. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 ; do
  1727.     if test ! -f ark${I}isdone ; then
  1728.     MISSING="${MISSING} ${I}"
  1729.     fi
  1730. done
  1731. if test "${MISSING}" = "" ; then
  1732.     echo You have unpacked all 13 archives.
  1733.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1734. else
  1735.     echo You still need to unpack the following archives:
  1736.     echo "        " ${MISSING}
  1737. fi
  1738. ##  End of shell archive.
  1739. exit 0
  1740. -- 
  1741.  
  1742. Rich $alz            "Anger is an energy"
  1743. Cronus Project, BBN Labs    rsalz@bbn.com
  1744. Moderator, comp.sources.unix    sources@uunet.uu.net
  1745.